package com.cennavi.buss.service.imp;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cennavi.buss.service.TokenService;
import com.cennavi.minemap.bean.MessageBean;

@FeignClient(value = "user-service", fallback = TokenService.class)
public interface ITokenService {

	@RequestMapping(method = RequestMethod.GET, value = "/service/token/limit")
	public Integer getLimit();

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/token/apply")
	public MessageBean apply(@RequestBody String json);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/token/update")
	public MessageBean update(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/token/list/{userId}")
	public MessageBean queryByUserId(@PathVariable(value = "userId") int userId);

	@RequestMapping(method = RequestMethod.GET, value = "/service/token/listOfNoSolu/{userId}")
	public MessageBean queryByUserIdOfNoSolu(@PathVariable(value = "userId") int userId);

	@RequestMapping(method = RequestMethod.GET, value = "/service/token/{id}")
	public MessageBean detail(@PathVariable(value = "id") String id);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/token/solu")
	public MessageBean insertTokenSolu(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/token/list/solu/{option}")
	public MessageBean queryBySoluUserId(@PathVariable(value = "option") String option,
			@RequestParam("soluId") int soluId, @RequestParam("userId") int userId);

}
